package com.keepmoving.web;

import com.keepmoving.po.Club;
import com.keepmoving.service.impl.ClubServiceImpl;
import com.keepmoving.vo.CourseInfo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class ClubController {
    @Resource
    ClubServiceImpl clubService;

    @RequestMapping("toclublist")
    public String toclublist(String sort,Model model){
        List<Club> list=clubService.findBySort(sort);
        model.addAttribute("list",list);
        return "clublist";
    }

    @RequestMapping("toclubinfo")
    public String toclubinfo(int clId,Model model){
       List<CourseInfo> list= clubService.findByClid(clId);
        System.out.println(list);
        model.addAttribute("list",list);
        return "clubinfo";
    }






}



